Spyder - Introduction
Spyder is a scientific Python Development environment.
- Spyder is a interactive development environment for the Python language with editing, interactive testing, debugging and introspection features
Spyder may also be used as a library providing powerful console-related widgets for your PyQt-based applications – for example, it may be used to integrate a debugging console directly in the layout of your graphical user interface.
Spyder websites:
Downloads, bug reports and feature requests: https://github.com/spyder-ide/spyder
Discussions: http://groups.google.com/group/spyderlib
Contents:
- Overview
- Installation
- Command line options
- Editor
- IPython Console
- Debugging
- Console
- Variable Explorer
- Help
- Projects
- Static code analysis
- File Explorer
- History log
- Find in files
- Online help
- Internal Console
Indices and tables:
Editor
Spyder’s text editor is a multi-language editor with features such as syntax coloring, code analysis (real-time code analysis powered bypyflakesand advanced code analysis usingpylint), introspection capabilities such as code completion, calltips and go-to-definition features (powered byrope), function/class browser, horizontal/vertical splitting features, etc.
Function/class/method browser:
Code analysis withpyflakes:
Horizontal/vertical splitting feature:
How to define a code cell
A “code cell” is a concept similar to MATLAB’s “cell” (except that there is no “cell mode” in Spyder), i.e. a block of lines to be executed at once in the current interpreter (Python or IPython). Every script may be divided in as many cells as needed.
Cells are separated by lines starting with:
- #%% (standard cell separator)
- # %% (standard cell separator, when file has been edited with Eclipse)
- # <codecell> (IPython notebook cell separator)
Related plugins:
Projects
Spyder allows users to associate a given directory with a project. This has two main advantages:
- Projects remember the list of open files in Editor. This permits to easily work on several coding efforts at the same time.
- The project’s path is added to the list of paths Python looks modules for, so that modules developed as part of a project can be easily imported in any console.
To create a project, it is necessary to select theNew Projectentry from theProjectsmenu:
When a project is activated, theProject explorerpane is shown, which presents a tree view structure of the current project
Through this pane it is possible to make several operations on the files that belong to project
Note
Projects are completely optional and not imposed on users, i.e. users can work without creating any project.
Version Control Integration
Spyder has limited integration withGitandMercurial. Commit and browse commands are available by right-clicking on relevant files that reside within an already initialized repository. This menu assume that certain commands are available on the system path.
- For Mercurial repositories, TortoiseHG must be installed, and either
thg
orhgtk
must be on the system path. - For git repositories, the commands
git
andgitk
must be on the system path. For Windows systems, the Git for Windows package provides a convenient installer and the option to place common git commands on the system path without creating conflicts with Windows system tools. The second option in the dialog below is generally a safe approach.